#!/bin/bash

#进入当前工作目录
cd `dirname $0`

echo 开始获取最新内容
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git pull
echo 获取更新执行结束！
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

echo 开始获取最近3三次提交日志
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git log -3
echo q
echo 退出日志查看执行结束！
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

echo 开始添加变更
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git add .
echo 执行结束！
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

echo;
echo 提交变更到本地仓库
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
read -p "请输入变更内容:" input
git commit -m "$input"

echo 数据成功提交到暂存库
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

echo;
echo 将变更情况提交到远程git服务器
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
git push origin master
echo 数据成功提交到服务器
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

echo;
echo 批处理执行完毕！
echo;

pause